package com.ruoyi.bom.controller;

import com.ruoyi.bom.domain.SysDept;
import com.ruoyi.bom.service.SysDeptService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: Jzh
 * @Date: 2024-01-18  20:08
 */
@RestController
@RequestMapping("/dept")
public class TqlDeptController extends BaseController {
    @Autowired
    private SysDeptService sysDeptService;

    /**
     * 获取部门列表
     */
//    @RequiresPermissions("bom:dept:query")
    @GetMapping(value = "/query")
    public TableDataInfo deptList()
    {
        List<SysDept> list = sysDeptService.selectDeptList();
        return getDataTable(list);
    }


    /**
     *   select k.shopCode,d.dept_code,d.dept_name,d.dept_id
     *         from tql_hll_kingdee k
     * left join sys_dept d on k.kingdeeDeptCode = d.dept_code
     *         where k.flag=1;
     */
    @GetMapping(value = "/enableShop")
    public AjaxResult enableShop()
    {
        List<SysDept> list = sysDeptService.selectEnableShop();
        return AjaxResult.success(list);
    }




}
